var bstop=true;
	/*点击二维码登录*/
			$('.login-tab-l').click(function(){
				$('.qrcode-login').css({'display': 'block','fontWeight': '700',
			    'color': '#e4393c'});
				$('.login-box').css({'display':'none','fontWeight': '100',
			    'color': '#666'});
				
			})
	/*点击账号登录*/
	$('.login-tab-r').click(function(){
		$('.login-box').css({'display':'block','fontweight':'700',color:'#e4393c'});
		$('.qrcode-login').css({'display':'none','fontweight':'100','color':'#666'});
	})
	$('input').focus(function(){
		$(this).css('border-color','blue')
		console.log(222)
	});
	$('input').blur(function(){
		$(this).css('border-color','#ddd')
		console.log(111)
	});
	$('input').focus(function(){
		$(this).css('background','lightyellow')
		console.log(333)
	});
	$('input').blur(function(){
		$(this).css('background','#C1C1C1')
		console.log(444)
	});
	
	$('.sub').click(function(){
		var $username=$('#loginname').val()
		var $password=$('#nloginpwd').val()
		console.log($username,$password);
		var url='http://jx.xuzhixiang.top/ap/api/login.php'
		var data={'username':$username,'password':$password}
		$.ajax({
			type:"get",
			url:url,
			async:true,
			data:data,
			success:function(res){
				
				var obj=JSON.parse(res);
				console.log(obj)
				if(obj.code){
					addCookie('token',obj.data.id,30);
					alert('登录成功！');
					location.href='../html/index-a.html';
				}else{
					alert('登录失败');
					location.reload();
				}
			},
			error:function(error){
				console.log(error);
			}
		});
	})

$('.regist-link').click(function(){
	location.href='../html/register.html';
})
